/*
behavior_follow();
*/
var team_prev;
if (ds_list_find_index(global.team,id) > 0)
{
team_prev = ds_list_find_value(global.team,ds_list_find_index(global.team,id) - 1);
}
else
{
team_prev = ds_list_find_value(global.team,ds_list_size(global.team) - 1);
}
if (global.control == 1)
{
character_sprint = (team_prev).character_sprint;
character_direction = (((x<team_prev.x)*2)-1);
if (on_screen(0) == false)
{
x = team_prev.x;
y = team_prev.y;
//alarm[1] = room_speed; <- invincibility
}
if (abs((team_prev).x - x) <= 40)
{
character_walk = false;
character_jump = false;
}
else{
if (actor_floorbelow(1) == true)
{
if ((team_prev).character_vsp == 0)
{
//dir = (((x<team_prev.x)*2)-1);
character_walk = (instance_place(x+((character_hsp + character_walksp)* character_direction),y,obj_solid) < 0);
if ((team_prev).y > y)
{
character_crouch = (place_meeting(x,y+1,obj_floor) == true);
character_jump = (place_meeting(x,y+1,obj_floor) == true);
}
if ((team_prev).y < y)
{
character_crouch = false;
character_jump = ((collision_line(x,y,x,(team_prev).y,obj_solid,false,true) < 0) || (instance_place(x+((character_hsp + character_walksp)*character_direction),y,obj_solid) > 0));
}
}
else
{
character_jump = false;
//dir = ((((x < (team_prev).x) && ((team_prev).x - x) > 32)*2)-1);
}
}
else
{
character_walk = (instance_place(x+((character_hsp + character_walksp)*character_direction),y,obj_solid) < 0);
//dir = ((((x < (team_prev).x) && ((team_prev).x - x) > 32)*2)-1);
character_crouch = false;
}
}
}
else
{
character_walk = false;
character_jump = false;
character_crouch = false;
}
